the full height nexus icon
 red n black circle yellow n black circle green n black circle 

[ Useful Internet Links ]

** Primary Note, ..
[ Read more ]

Note: if you see a (*) against a menu option, means that the article has a download link associated with it.


WordPress developer, ..
(( search box )) located here.

WPBeginer, gotta say here: that this website has some really cool stuff on it, and it ain’t just for beginners neither, but it does has a Noob approach to searching for stuff. It also has a very heavy emphasis on the over-use of paid Plugins in my opinion.

StackOverFlow, not a Noob in sight: except for some of the unresearched questions being asked, here be the questionable search box in, ..
(( question ))

The Mozilla support site is a right royal bitch to navigate, but it does have some real neat stuff on it to peruse. Downside, you do really need to know what you want to find — before even looking for it. The place is not Noob friendly at all, that said, it’s got shed loads of brilliant examples.

But above all, there’s the king ‘n’ queen of all searches, ..
Google itself.

** Remember, this stuff discussed here can kill your website stone dead, so only proceed with a current backup under your belt.

This page title is, ..

[ Howtoo: making a WordPress Widget ]

Just read between the lines, you’ll be fine:-

Cautionary notationally tale on naming plugins: before we begin, — Dumb! — Dumb! — Dar – Dar!

The plugin being called ‘Unique Named Dashboard Widget‘, might well not be (unique) enough. Because out there, in the other myriad-multi-verse of the many WordPress site worlds, .. another Plugin Author, might well have used ‘Unique Named Dashboard Widget’ it for their own plugin name as well.

** And if that happens, and you install it: then we’ve got problems in River City.

Hint – use your own domain name and initials for all of your plugins and function naming conventions.

So if you are calling yourself ‘xyz-Freds-Blog(dot-com)’ then use, ..

function xyz-Freds-Blog-dot-com() // for the unique named dashboard widget.

What this actually means, is that you’ve got a better than fifty fifty chance, of **not** bumping into ‘xyz-Freds-Blog-dot-com’ — which is a unique named dashboard widget, reflecting her most amazing backend 3D rendering plugin, that boosts web loading speeds by almost 99%. A super duper plugin that everyone’s installing: including you, but several years later, .. (butt!) .. your users have also got your own most amazing unique plugin installed, ..

And it’s installed on their many worlds web-sites as well. It really is a River City pool-hall kinda’ problem, — With no shootin’ monkey boys knowing nuffin’ — Cos day’ do’s shoot dee’ pool all day long and nots’ learns’ nuffin — eave’er! — What-Ever!

Which could well happen, especially with (all) of those great many eternal monkeys out there, .. (all) happily banging away on their interminable typewriters, .. (all) trying absentmindedly to write a Shakespearian play, .. tap, .. tap, .. tap, .. was dat’ unique enough as a learning construct?

The warning below is also included in (all) my rapid tutorials, tap, .. tap, .. tap, .. with this quote from the web being the one that inspired it.


“Might I suggest, that you add a line of code to all PHP files — to thusly prevent access out with WordPress? It’s just good security practice to use:-

if (!defined(‘ABSPATH’)) { exit; }”

What it means, (from research), is that if this PHP file is called directly, (then abort,) because it’s possible being targeted by a scum-bag-hacker.

Done so, as no plugin is ever called directly, (apparently!), btw exit or die, it makes no difference – the connection is killed stone-dead, .. whilst we’re (all) jabbering at the foot of the Black-Monolith.

if ( ! defined( ‘ABSPATH’ ) ) { die; }

OK, so sense, but why isn’t it used in the WordPress (functions.php) file? – Answers on a postcard please! – and no, even dem’ sniffy WordPress programmers can’t answers it ee-ver!!


So, we are now we finally in a position to proceed on with making our unique Backend WIDGET.

INSTALL NOTES, From u-Tube by Josh Henson.

In the rapid tutorial, he created a directory in the wp-content/plugins folder called .. ‘unique-admin-dashboard-widget’
The author then made a matching file in it called:- ‘unique-admin-dashboard-widget.php’

That is your framework ..

Running ops:- ‘wp_dashboard_setup’ — as used below is a (hook or action), and is the actually procedure to get the back-end widget up and running.

‘wp_add_dashboard_widget’
This is a WP function that adds the widget itself to the (Admin backend), did it hurt?

Making a fully functioning widget only requires three variables to create it function.

Only copy text below this line.

<?php /* Plugin Name: Unique Named Dashboard Widget */
// vv----- the normal function name used here would not be unique enough btw.
admin_dashboard_widget( ) 
{ 
wp_add_dashboard_widget 
(
/* the above is an internal WP procedural function, that only requires 3 variables. */

'admin_dashboard_widget',
// ^^---- 1.) 'the slug' to be used, and "is good enough", but could be uniquer!

'Admin Dashboard Widget Title', 
/* ^^---- 2.) 'the title', simply being Human Readable, all good; as long as it understood, ie:unique. */

'admin_dashboard_widget_callback' 
/* ^^---- 3.) name as used in the function below, .. which is actually used to output your HTML-DIV-PHP stuff etc. */
); 
} 
add_action( 'wp_dashboard_setup' , 'admin_dashboard_widget' );
/* ^^------- 'wp_dashboard_setup' is an internal WP procedural function. */
/* 'wp_add_dashboard_widget' is what you called your function above. */

function admin_dashboard_widget_callback( ) 
{ 
/* This is where you do HTML stuff, on the screen, at the widget's location. */
echo 'hello world.'; 
/* This would be a start to kickstart your imagination. */
?>

Only copy the text above this line.

How to proceed from here, ..
Save the text in the page block above.
Hold the Shift Key and allow the text to be selected — line by line till you see the corresponding, only copy text below this line,

Press Ctrl-C (it copies the selected highlighted text to the internal clipboard.)

In the **blank** page of your text editor, you’d use:-
Ctrl-V (to paste the text held in the internal clipboard.)

Next, make a directory off of the,
wp-content/plugins folder
And call it,
unique-admin-dashboard-widget

** Note: good WP programming dictates that the plugin directory — must have the same name as the plugin file-name.

Finally, in the above directory, (folder) save the file as,
unique-admin-dashboard-widget.php

Then, in your WordPress Plugins Screen, ..
Press [Ctrl-F5] (which will refresh the backend.)

In the list of Plugins, you’ll see yours:
(Activate) the new Unique Admin Dashboard Widget found in the Plugins Screen.
Goto the Admin Backend Panel.
Then move around Unique Admin Dashboard Widget found there that says ‘Hello World.

Well done, .. you’ve made a pretty useless WordPress Widget.

 

Thanks for reading, Jessica: Praise be the ORI.

 

Information.

email icon This is my email address.



Your message may get put into the spam folder if my internet provided thinks it a bit phishy. So as an alternative — you can also use shopper@b92.co.uk if you so wish.

** This particular email address declared above, has positively and absolutely no spam filters on it, (at all), which means that positively and absolutely *everything* gets through.

Thanks for seeking me out, Jessica:
Praise be the ORI.

Information.

Disclaimer:-
The stuff found here in the Nexus is for amusement purposes only, and I guarantee that none of it is fit for purpose.

SO! – With that Pop-up popped up and properly put to bed, then the legal garbage is outta’ of the way.

Thanks for reading the trash, Jessica:
Praise be the ORI.

WARNING!

To view this website, you must be considered as an ADULT (with legal consent) in your current location to proceed any further.

Failure to comply, could result in a criminal prosecution (within the local domicile) that you physically reside.

This book site isn't for children, nor any childish attitudes towards sexual ambivalence. It is for -- ADULTS ONLY!

Pressing [ No! ] - Will take you away, to another type of less salubrious activity that's more suited to your young tender age (and/or) delicate disposition.

Only press [ YES! ] - If you understand these legally binding terms and conditions. Whereby, a one year cookie will be set on your browser: thusly declaring you to be an adult, (a constitutional time-Warrior), with all of your timely facilities intact.

It's a big decision that you're about to undertake coder, choose wisely: because you can never go back.